package com.example.dnfgamercommunitybackend.service.impl;

import com.example.dnfgamercommunitybackend.dao.RecommendArticleDao;
import com.example.dnfgamercommunitybackend.entity.Article;
import com.example.dnfgamercommunitybackend.entity.ResponseResult;
import com.example.dnfgamercommunitybackend.service.RecommendArticleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RecommendArticleControllerImpl implements RecommendArticleService {
    @Resource
    private RecommendArticleDao recommendArticleDao;
    @Override
    public String getRecommendArticle() {
        List<Article> articles = recommendArticleDao.getRecommendArticle();
        if (articles.isEmpty()){
            return ResponseResult.failureStringResult("响应失败");
        }
        return ResponseResult.successStringResult("响应成功",articles);
    }
}
